<%@ page contentType="text/html;charset=GB2312"%>
<%@ page import="java.sql.*"%>
<%@ page import="javax.sql.*"%>
<%@ page import="javax.naming.*"%>
<html>
  <head>
    
    
    <title>My JSP 'test20061113_mayh.jsp' starting page</title>

  </head>
  
  <body>
 <%
 
 Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    DataSource ds = (DataSource) envCtx.lookup("jdbc/TestDB");  
    Connection conn = ds.getConnection();
    Statement stmt = conn.createStatement();
    
    
   // sql_update="update mger_users set mger_type='"+mger_type+"' where mger_id="+mger_id;
    
 //   stmt.executeUpdate(sql_update);
    
   String sql_check="select * from users";
    ResultSet rs = stmt.executeQuery(sql_check);
   
    while (rs.next()) {
    out.println(rs.getString("username"));
    }
    rs.close();
    stmt.close();
    conn.close();
   // envCtx.close();
  //  initCtx.close();
    
 %>
  </body>
</html>
